#define _CRT_SECURE_NO_WARNINGS	

int integersum(int n)
{
    int sum = 0;
    int find = 1;
    int count = 0;
    for (int i = n; i >= 7; i--)
    {
        if (i % 7 == 0 || i % 11 == 0)
        {
            find = 0;
            count++;
            sum += i;
            if (count == 6)
                return sum;
        }
    }
    if (find)
        return 0;
    return sum;
}